;******* ColecoVision I/O Decoder ******** ;A7 = 1 (ENABLE DECODER) ;A6 A5 Wr ;0 0 0 y0 write ctrl EN 2 ;0 0 1 y1 read nothing ;0 1 0 y2 write VDP ;0 1 1 y3 read VDP ;1 0 0 y4 write ctrl EN 1 ;1 0 1 y5 read nothing ;1 1 0 y6 write audio ;1 1 1 y7 read ctrl input ;101X XXX0 VDP Wr REG 0xA0 ;101X XXX0 VDP Rd REG 0xA0 ;101X XXX1 VDP Wr RAM 0xA1 ;101X XXX1 VDP Rd RAM 0xA1 ;100X XXXX ctrl Wr EN 2 0x80 ;110X XXXX ctrl Wr EN 1 0xC0 ;111X XXXX ctrl Rd input 0xFF ;111X XXXX aud Wr out 0xFF ;**************** H2Z80 I/O Decoder **************** ;A7 A6 A5 A4 ;0 0 0 0 y0 write leds 0x00 ;0 0 0 1 y1 Wr/Rd CF card (A1 - A3) 0x10 ;0 0 1 0 y2 Wr/Rd nothing 0x20 ;0 0 1 1 y3 write bank sw (A3) 0x30 ;0 1 0 0 y4 Wr/Rd nothing 0x40 ;0 1 0 1 y5a Wr/Rd PIO Pa (A1) 0x50 ;0 1 0 1 y5b Wr/Rd PIO Pb (A1) 0x52 ;0 1 1 0 y6 Wr/Rd nothing 0x60 ;0 1 1 1 y7 Wr/Rd nothing 0x70 ;1 0 0 0 y8a Wr/Rd SIO Pa (A1) 0x80 ;1 0 0 0 y8b Wr/Rd SIO Pb (A1) 0x82 ;1 0 0 1 y9 Wr/Rd IDE HD (A1 - A3) 0x90 ;1 0 1 0 yA Wr/Rd nothing 0xA0 ;1 0 1 1 yB Wr/Rd VDP (A0) 0xB0 ;1 1 0 0 yC Wr/Rd nothing 0xC0 ;1 1 0 1 yD Wr/Rd nothing 0xD0 ;1 1 1 0 yEa read ctrl 1 (A0) 0xE0 ;1 1 1 0 yEb read ctrl 2 (A0) 0xE1 ;1 1 1 1 yFa write sound L (A0) 0xF0 ;1 1 1 1 yFb write sound R (A0) 0xF1 ;**************** Coleco Controller Memory Map **************** ;S0_C0 = 80h + p1_fire1 + p1_joy ;S1_C0 = 80h + p1_fire2 + p1_keypad ;S0_C1 = 80h + p2_fire1 + p2_joy ;S1_C1 = 80h + p2_fire2 + p2_keypad 73F1h S1_C1 73F0h S1_C0 73EFh S0_C1 73EEh S0_C0 8008h controller map pointer → 0200h (Its ROM deppendent) 0200h p1 enable (8008h) + 0 0202h p1 fire (8008h) + 2 0203h p1 joy (8008h) + 3 0204h p1 spinner (8008h) + 4 0205h p1 arm (8008h) + 5 0206h p1 keypad (8008h) + 6 0201h p2 enable (8008h) + 1 0207h p2 fire (8008h) + 7 0208h p2 joy (8008h) + 8 0209h p2 spinner (8008h) + 9 020Ah p2 arm (8008h) + 10 020Bh p2 keypad (8008h) + 11 S0_C0 = 80 + p1 fire1 + p1 joystick S1_C0 = 80 + p1 fire2 + p1 keypad S0_C1 = 80 + p2 fire1 + p2 joystick S1_C1 = 80 + p2 fire2 + p2 keypad ;**************** Coleco Controller Buttons Decode **************** ;p1 fire1 *8008h + 1 ; nothing = 0fh ; f1 = 40h ;p1 joystick: *8008h + 2 ; nothing = 0 ; up = 1h ; rg = 2h ; dw = 4h ; lf = 8h ;p1 spinner *8008h + 3 ;p1 arm (fire2) *8008h + 4 ; nothing = 0fh ; f2 = 40h ;p1 keypad *8008h + 5 ; nothing = 0fh ; 0 = 0h ; 1 = 1h !!! ; 2 = 2h ; 3 = 3h ; 4 = 4h !!! ; 5 = 5h ; 6 = 6h ; 7 = 7h ; 8 = 8h ; 9 = 9h ; * = Ah !!! ; # = Bh !!! ;p1 keypad S1_C0 ; nothing = 80 ; 0 = +5h ; 1 = +2h ; 2 = +8h ; 3 = +3h ; 4 = +Dh ; 5 = +Ch ; 6 = +1h ; 7 = +Ah ; 8 = +Eh ; 9 = +4h ; * = +6h ; # = +9h